//
//  RxDZNEmptyDataSetDelegateProxy.swift
//  RxDZNEmptyDataSet
//
//  Created by melvyn on 2018/8/17.
//  Copyright © 2018 NEET. All rights reserved.
//

import UIKit
import RxCocoa

open class RxDZNEmptyDataSetDelegateProxy
    : DelegateProxy<UIScrollView, DZNEmptyDataSetDelegate>
, DelegateProxyType {
    
    public weak private(set) var scrollView: UIScrollView?
    
    public init(scrollView: ParentObject) {
        self.scrollView = scrollView
        
        super.init(parentObject: scrollView, delegateProxy: RxDZNEmptyDataSetDelegateProxy.self)
    }
    
    public static func registerKnownImplementations() {
        self.register { RxDZNEmptyDataSetDelegateProxy(scrollView: $0) }
    }
    
    public static func currentDelegate(for object: UIScrollView) -> DZNEmptyDataSetDelegate? {
        return object.emptyDataSetDelegate
    }
    
    public static func setCurrentDelegate(_ delegate: DZNEmptyDataSetDelegate?, to object: UIScrollView) {
        object.emptyDataSetDelegate = delegate
    }
    
}
